function [avg_energy] = avg_msg_energy ()
    global used_energy;
    global energy_after_init;
    global iterations;
    
    if iterations~=1 
        avg_energy=fix(((used_energy-energy_after_init)/(iterations-1))*10)/10;
    else
        avg_energy=0;
    end;
    
end

